package sk.hackcraft.util.simulation;

public abstract class Event implements Comparable<Event>
{
	private final double time;
	private Replication replication;
	
	public Event(double time)
	{
		this.time = time;
	}
	
	public double getTime()
	{
		return time;
	}
	
	protected void setReplication(Replication replication)
	{
		this.replication = replication;
	}
	
	protected Replication getReplication()
	{
		return replication;
	}

	@Override
	public int compareTo(Event event)
	{
		if(this.getTime() > event.getTime())
		{
			return 1;
		}
		else if(this.getTime() < event.getTime())
		{
			return -1;
		}
		else
		{
			return 0;
		}
	}
	
	public abstract void execute();
}
